<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: pcl::DecisionTreeEvaluator&lt; FeatureType, DataSet, LabelType, ExampleIndex, NodeType &gt; 模板类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classpcl_1_1_decision_tree_evaluator.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="classpcl_1_1_decision_tree_evaluator-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">pcl::DecisionTreeEvaluator&lt; FeatureType, DataSet, LabelType, ExampleIndex, NodeType &gt; 模板类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>Utility class for evaluating a decision tree.  
 <a href="classpcl_1_1_decision_tree_evaluator.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="decision__tree__evaluator_8h_source.html">decision_tree_evaluator.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a31de287e8c005457a69ffd762ed74986"><td class="memItemLeft" align="right" valign="top"><a id="a31de287e8c005457a69ffd762ed74986"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_decision_tree_evaluator.html#a31de287e8c005457a69ffd762ed74986">DecisionTreeEvaluator</a> ()</td></tr>
<tr class="memdesc:a31de287e8c005457a69ffd762ed74986"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br /></td></tr>
<tr class="separator:a31de287e8c005457a69ffd762ed74986"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a013ddb4281880e8237b17a5f1eca08c0"><td class="memItemLeft" align="right" valign="top"><a id="a013ddb4281880e8237b17a5f1eca08c0"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_decision_tree_evaluator.html#a013ddb4281880e8237b17a5f1eca08c0">~DecisionTreeEvaluator</a> ()</td></tr>
<tr class="memdesc:a013ddb4281880e8237b17a5f1eca08c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:a013ddb4281880e8237b17a5f1eca08c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add82a97bc17ec20c553a6f15465655a1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_decision_tree_evaluator.html#add82a97bc17ec20c553a6f15465655a1">evaluate</a> (<a class="el" href="classpcl_1_1_decision_tree.html">pcl::DecisionTree</a>&lt; NodeType &gt; &amp;tree, <a class="el" href="classpcl_1_1_feature_handler.html">pcl::FeatureHandler</a>&lt; FeatureType, DataSet, ExampleIndex &gt; &amp;feature_handler, <a class="el" href="classpcl_1_1_stats_estimator.html">pcl::StatsEstimator</a>&lt; LabelType, NodeType, DataSet, ExampleIndex &gt; &amp;stats_estimator, DataSet &amp;data_set, std::vector&lt; ExampleIndex &gt; &amp;examples, std::vector&lt; LabelType &gt; &amp;label_data)</td></tr>
<tr class="memdesc:add82a97bc17ec20c553a6f15465655a1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Evaluates the specified examples using the supplied tree.  <a href="classpcl_1_1_decision_tree_evaluator.html#add82a97bc17ec20c553a6f15465655a1">更多...</a><br /></td></tr>
<tr class="separator:add82a97bc17ec20c553a6f15465655a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad96de842d464f3e62f98d8527f7e6654"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_decision_tree_evaluator.html#ad96de842d464f3e62f98d8527f7e6654">evaluateAndAdd</a> (<a class="el" href="classpcl_1_1_decision_tree.html">pcl::DecisionTree</a>&lt; NodeType &gt; &amp;tree, <a class="el" href="classpcl_1_1_feature_handler.html">pcl::FeatureHandler</a>&lt; FeatureType, DataSet, ExampleIndex &gt; &amp;feature_handler, <a class="el" href="classpcl_1_1_stats_estimator.html">pcl::StatsEstimator</a>&lt; LabelType, NodeType, DataSet, ExampleIndex &gt; &amp;stats_estimator, DataSet &amp;data_set, std::vector&lt; ExampleIndex &gt; &amp;examples, std::vector&lt; LabelType &gt; &amp;label_data)</td></tr>
<tr class="memdesc:ad96de842d464f3e62f98d8527f7e6654"><td class="mdescLeft">&#160;</td><td class="mdescRight">Evaluates the specified examples using the supplied tree and adds the results to the supplied results array.  <a href="classpcl_1_1_decision_tree_evaluator.html#ad96de842d464f3e62f98d8527f7e6654">更多...</a><br /></td></tr>
<tr class="separator:ad96de842d464f3e62f98d8527f7e6654"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad9993940848679cc137b4a05cc3f86b2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_decision_tree_evaluator.html#ad9993940848679cc137b4a05cc3f86b2">evaluate</a> (<a class="el" href="classpcl_1_1_decision_tree.html">pcl::DecisionTree</a>&lt; NodeType &gt; &amp;tree, <a class="el" href="classpcl_1_1_feature_handler.html">pcl::FeatureHandler</a>&lt; FeatureType, DataSet, ExampleIndex &gt; &amp;feature_handler, <a class="el" href="classpcl_1_1_stats_estimator.html">pcl::StatsEstimator</a>&lt; LabelType, NodeType, DataSet, ExampleIndex &gt; &amp;stats_estimator, DataSet &amp;data_set, ExampleIndex example, NodeType &amp;leave)</td></tr>
<tr class="memdesc:ad9993940848679cc137b4a05cc3f86b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Evaluates the specified examples using the supplied tree.  <a href="classpcl_1_1_decision_tree_evaluator.html#ad9993940848679cc137b4a05cc3f86b2">更多...</a><br /></td></tr>
<tr class="separator:ad9993940848679cc137b4a05cc3f86b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a18563d9a5cc4560f7cda89e0ee3ea2ae"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_decision_tree_evaluator.html#a18563d9a5cc4560f7cda89e0ee3ea2ae">getNodes</a> (<a class="el" href="classpcl_1_1_decision_tree.html">pcl::DecisionTree</a>&lt; NodeType &gt; &amp;tree, <a class="el" href="classpcl_1_1_feature_handler.html">pcl::FeatureHandler</a>&lt; FeatureType, DataSet, ExampleIndex &gt; &amp;feature_handler, <a class="el" href="classpcl_1_1_stats_estimator.html">pcl::StatsEstimator</a>&lt; LabelType, NodeType, DataSet, ExampleIndex &gt; &amp;stats_estimator, DataSet &amp;data_set, std::vector&lt; ExampleIndex &gt; &amp;examples, std::vector&lt; NodeType * &gt; &amp;nodes)</td></tr>
<tr class="memdesc:a18563d9a5cc4560f7cda89e0ee3ea2ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Evaluates the specified examples using the supplied tree.  <a href="classpcl_1_1_decision_tree_evaluator.html#a18563d9a5cc4560f7cda89e0ee3ea2ae">更多...</a><br /></td></tr>
<tr class="separator:a18563d9a5cc4560f7cda89e0ee3ea2ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><h3>template&lt;class FeatureType, class DataSet, class LabelType, class ExampleIndex, class NodeType&gt;<br />
class pcl::DecisionTreeEvaluator&lt; FeatureType, DataSet, LabelType, ExampleIndex, NodeType &gt;</h3>

<p>Utility class for evaluating a decision tree. </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="ad9993940848679cc137b4a05cc3f86b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad9993940848679cc137b4a05cc3f86b2">&#9670;&nbsp;</a></span>evaluate() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1_decision_tree_evaluator.html">pcl::DecisionTreeEvaluator</a>&lt; FeatureType, DataSet, LabelType, ExampleIndex, NodeType &gt;::evaluate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_decision_tree.html">pcl::DecisionTree</a>&lt; NodeType &gt; &amp;&#160;</td>
          <td class="paramname"><em>tree</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_feature_handler.html">pcl::FeatureHandler</a>&lt; FeatureType, DataSet, ExampleIndex &gt; &amp;&#160;</td>
          <td class="paramname"><em>feature_handler</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_stats_estimator.html">pcl::StatsEstimator</a>&lt; LabelType, NodeType, DataSet, ExampleIndex &gt; &amp;&#160;</td>
          <td class="paramname"><em>stats_estimator</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">DataSet &amp;&#160;</td>
          <td class="paramname"><em>data_set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ExampleIndex&#160;</td>
          <td class="paramname"><em>example</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">NodeType &amp;&#160;</td>
          <td class="paramname"><em>leave</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Evaluates the specified examples using the supplied tree. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tree</td><td>The decision tree. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">feature_handler</td><td>The feature handler used to train the tree. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">stats_estimator</td><td>The statistics estimation instance used while training the tree. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data_set</td><td>The data set used for evaluation. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">example</td><td>The example that has to be evaluated. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">leave</td><td>The leave reached by the examples. </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;{</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    NodeType * node = &amp;(tree.<a class="code" href="classpcl_1_1_decision_tree.html#a67bb781f8421e638107344a37cf0b718">getRoot</a> ());</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160; </div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keywordflow">while</span> (node-&gt;sub_nodes.size () != 0)</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    {</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;      <span class="keywordtype">float</span> feature_result = 0.0f;</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;      <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> flag = 0;</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;      <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> branch_index = 0;</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160; </div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;      feature_handler.<a class="code" href="classpcl_1_1_feature_handler.html#a1131f1c17f4b600506c88ca722902ae5">evaluateFeature</a> (node-&gt;feature, data_set, example, feature_result, flag);</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;      stats_estimator.<a class="code" href="classpcl_1_1_stats_estimator.html#ae91303f940dffa974c8f980fa8736426">computeBranchIndex</a> (feature_result, flag, node-&gt;threshold, branch_index);</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160; </div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;      node = &amp;(node-&gt;sub_nodes[branch_index]);</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    }</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160; </div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    leave = *node;</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160; </div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;}</div>
<div class="ttc" id="aclasspcl_1_1_decision_tree_html_a67bb781f8421e638107344a37cf0b718"><div class="ttname"><a href="classpcl_1_1_decision_tree.html#a67bb781f8421e638107344a37cf0b718">pcl::DecisionTree::getRoot</a></div><div class="ttdeci">NodeType &amp; getRoot()</div><div class="ttdoc">Returns the root node of the tree.</div><div class="ttdef"><b>Definition:</b> decision_tree.h:73</div></div>
<div class="ttc" id="aclasspcl_1_1_feature_handler_html_a1131f1c17f4b600506c88ca722902ae5"><div class="ttname"><a href="classpcl_1_1_feature_handler.html#a1131f1c17f4b600506c88ca722902ae5">pcl::FeatureHandler::evaluateFeature</a></div><div class="ttdeci">virtual void evaluateFeature(const FeatureType &amp;feature, DataSet &amp;data_set, std::vector&lt; ExampleIndex &gt; &amp;examples, std::vector&lt; float &gt; &amp;results, std::vector&lt; unsigned char &gt; &amp;flags) const =0</div><div class="ttdoc">Evaluates a feature on the specified data.</div></div>
<div class="ttc" id="aclasspcl_1_1_stats_estimator_html_ae91303f940dffa974c8f980fa8736426"><div class="ttname"><a href="classpcl_1_1_stats_estimator.html#ae91303f940dffa974c8f980fa8736426">pcl::StatsEstimator::computeBranchIndex</a></div><div class="ttdeci">virtual void computeBranchIndex(const float result, const unsigned char flag, const float threshold, unsigned char &amp;branch_index) const =0</div><div class="ttdoc">Computes the branch indices obtained by the specified threshold on the supplied feature evaluation re...</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="add82a97bc17ec20c553a6f15465655a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add82a97bc17ec20c553a6f15465655a1">&#9670;&nbsp;</a></span>evaluate() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1_decision_tree_evaluator.html">pcl::DecisionTreeEvaluator</a>&lt; FeatureType, DataSet, LabelType, ExampleIndex, NodeType &gt;::evaluate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_decision_tree.html">pcl::DecisionTree</a>&lt; NodeType &gt; &amp;&#160;</td>
          <td class="paramname"><em>tree</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_feature_handler.html">pcl::FeatureHandler</a>&lt; FeatureType, DataSet, ExampleIndex &gt; &amp;&#160;</td>
          <td class="paramname"><em>feature_handler</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_stats_estimator.html">pcl::StatsEstimator</a>&lt; LabelType, NodeType, DataSet, ExampleIndex &gt; &amp;&#160;</td>
          <td class="paramname"><em>stats_estimator</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">DataSet &amp;&#160;</td>
          <td class="paramname"><em>data_set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; ExampleIndex &gt; &amp;&#160;</td>
          <td class="paramname"><em>examples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; LabelType &gt; &amp;&#160;</td>
          <td class="paramname"><em>label_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Evaluates the specified examples using the supplied tree. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tree</td><td>The decision tree. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">feature_handler</td><td>The feature handler used to train the tree. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">stats_estimator</td><td>The statistics estimation instance used while training the tree. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data_set</td><td>The data set used for evaluation. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">examples</td><td>The examples that have to be evaluated. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">label_data</td><td>The destination for the resulting label data. </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;{</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">size_t</span> num_of_examples = examples.size ();</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  label_data.resize (num_of_examples);</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> example_index = 0; example_index &lt; num_of_examples; ++example_index)</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  {</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    NodeType * node = &amp;(tree.<a class="code" href="classpcl_1_1_decision_tree.html#a67bb781f8421e638107344a37cf0b718">getRoot</a> ());</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordflow">while</span> (node-&gt;sub_nodes.size () != 0)</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    {</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;      <span class="keywordtype">float</span> feature_result = 0.0f;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;      <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> flag = 0;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;      <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> branch_index = 0;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;      feature_handler.<a class="code" href="classpcl_1_1_feature_handler.html#a1131f1c17f4b600506c88ca722902ae5">evaluateFeature</a> (node-&gt;feature, data_set, examples[example_index], feature_result, flag);</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;      stats_estimator.<a class="code" href="classpcl_1_1_stats_estimator.html#ae91303f940dffa974c8f980fa8736426">computeBranchIndex</a> (feature_result, flag, node-&gt;threshold, branch_index);</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160; </div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;      node = &amp;(node-&gt;sub_nodes[branch_index]);</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    }</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    label_data[example_index] = stats_estimator.<a class="code" href="classpcl_1_1_stats_estimator.html#a81eeb44edc44226e45e9559b8c6adf03">getLabelOfNode</a> (*node);</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;  }</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;}</div>
<div class="ttc" id="aclasspcl_1_1_stats_estimator_html_a81eeb44edc44226e45e9559b8c6adf03"><div class="ttname"><a href="classpcl_1_1_stats_estimator.html#a81eeb44edc44226e45e9559b8c6adf03">pcl::StatsEstimator::getLabelOfNode</a></div><div class="ttdeci">virtual LabelDataType getLabelOfNode(NodeType &amp;node) const =0</div><div class="ttdoc">Returns the label of the specified node.</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="ad96de842d464f3e62f98d8527f7e6654"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad96de842d464f3e62f98d8527f7e6654">&#9670;&nbsp;</a></span>evaluateAndAdd()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1_decision_tree_evaluator.html">pcl::DecisionTreeEvaluator</a>&lt; FeatureType, DataSet, LabelType, ExampleIndex, NodeType &gt;::evaluateAndAdd </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_decision_tree.html">pcl::DecisionTree</a>&lt; NodeType &gt; &amp;&#160;</td>
          <td class="paramname"><em>tree</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_feature_handler.html">pcl::FeatureHandler</a>&lt; FeatureType, DataSet, ExampleIndex &gt; &amp;&#160;</td>
          <td class="paramname"><em>feature_handler</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_stats_estimator.html">pcl::StatsEstimator</a>&lt; LabelType, NodeType, DataSet, ExampleIndex &gt; &amp;&#160;</td>
          <td class="paramname"><em>stats_estimator</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">DataSet &amp;&#160;</td>
          <td class="paramname"><em>data_set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; ExampleIndex &gt; &amp;&#160;</td>
          <td class="paramname"><em>examples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; LabelType &gt; &amp;&#160;</td>
          <td class="paramname"><em>label_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Evaluates the specified examples using the supplied tree and adds the results to the supplied results array. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tree</td><td>The decision tree. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">feature_handler</td><td>The feature handler used to train the tree. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">stats_estimator</td><td>The statistics estimation instance used while training the tree. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data_set</td><td>The data set used for evaluation. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">examples</td><td>The examples that have to be evaluated. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">label_data</td><td>The destination where the resulting label data is added to. </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;{</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">size_t</span> num_of_examples = examples.size ();</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> example_index = 0; example_index &lt; num_of_examples; ++example_index)</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;  {</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    NodeType * node = &amp;(tree.<a class="code" href="classpcl_1_1_decision_tree.html#a67bb781f8421e638107344a37cf0b718">getRoot</a> ());</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordflow">while</span> (node-&gt;sub_nodes.size () != 0)</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    {</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;      <span class="keywordtype">float</span> feature_result = 0.0f;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;      <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> flag = 0;</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;      <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> branch_index = 0;</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160; </div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;      feature_handler.<a class="code" href="classpcl_1_1_feature_handler.html#a1131f1c17f4b600506c88ca722902ae5">evaluateFeature</a> (node-&gt;feature, data_set, examples[example_index], feature_result, flag);</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;      stats_estimator.<a class="code" href="classpcl_1_1_stats_estimator.html#ae91303f940dffa974c8f980fa8736426">computeBranchIndex</a> (feature_result, flag, node-&gt;threshold, branch_index);</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160; </div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;      node = &amp;(node-&gt;sub_nodes[branch_index]);</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    }</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160; </div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    label_data[example_index] += stats_estimator.<a class="code" href="classpcl_1_1_stats_estimator.html#a81eeb44edc44226e45e9559b8c6adf03">getLabelOfNode</a> (*node);</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;  }</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a18563d9a5cc4560f7cda89e0ee3ea2ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a18563d9a5cc4560f7cda89e0ee3ea2ae">&#9670;&nbsp;</a></span>getNodes()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class FeatureType , class DataSet , class LabelType , class ExampleIndex , class NodeType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1_decision_tree_evaluator.html">pcl::DecisionTreeEvaluator</a>&lt; FeatureType, DataSet, LabelType, ExampleIndex, NodeType &gt;::getNodes </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_decision_tree.html">pcl::DecisionTree</a>&lt; NodeType &gt; &amp;&#160;</td>
          <td class="paramname"><em>tree</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_feature_handler.html">pcl::FeatureHandler</a>&lt; FeatureType, DataSet, ExampleIndex &gt; &amp;&#160;</td>
          <td class="paramname"><em>feature_handler</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_stats_estimator.html">pcl::StatsEstimator</a>&lt; LabelType, NodeType, DataSet, ExampleIndex &gt; &amp;&#160;</td>
          <td class="paramname"><em>stats_estimator</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">DataSet &amp;&#160;</td>
          <td class="paramname"><em>data_set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; ExampleIndex &gt; &amp;&#160;</td>
          <td class="paramname"><em>examples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; NodeType * &gt; &amp;&#160;</td>
          <td class="paramname"><em>nodes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Evaluates the specified examples using the supplied tree. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tree</td><td>The decision tree. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">feature_handler</td><td>The feature handler used to train the tree. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">stats_estimator</td><td>The statistics estimation instance used while training the tree. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data_set</td><td>The data set used for evaluation. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">examples</td><td>The examples that have to be evaluated. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">nodes</td><td>The leaf-nodes reached while evaluation. </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;{</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">size_t</span> num_of_examples = examples.size ();</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> example_index = 0; example_index &lt; num_of_examples; ++example_index)</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;  {</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    NodeType * node = &amp;(tree.<a class="code" href="classpcl_1_1_decision_tree.html#a67bb781f8421e638107344a37cf0b718">getRoot</a> ());</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160; </div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <span class="keywordflow">while</span> (node-&gt;sub_nodes.size () != 0)</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    {</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;      <span class="keywordtype">float</span> feature_result = 0.0f;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;      <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> flag = 0;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;      <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> branch_index = 0;</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160; </div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;      feature_handler.<a class="code" href="classpcl_1_1_feature_handler.html#a1131f1c17f4b600506c88ca722902ae5">evaluateFeature</a> (node-&gt;feature, data_set, examples[example_index], feature_result, flag);</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;      stats_estimator.<a class="code" href="classpcl_1_1_stats_estimator.html#ae91303f940dffa974c8f980fa8736426">computeBranchIndex</a> (feature_result, node-&gt;threshold, flag, branch_index);</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160; </div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;      node = &amp;(node-&gt;subNodes[branch_index]);</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    }</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160; </div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    nodes.push_back(node);</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;  }</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>ml/include/pcl/ml/dt/<a class="el" href="decision__tree__evaluator_8h_source.html">decision_tree_evaluator.h</a></li>
<li>ml/include/pcl/ml/impl/dt/<a class="el" href="decision__tree__evaluator_8hpp_source.html">decision_tree_evaluator.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>pcl</b></li><li class="navelem"><a class="el" href="classpcl_1_1_decision_tree_evaluator.html">DecisionTreeEvaluator</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
